package com.defines.ming.demo.utils;


import com.defines.ming.demo.model.Result;

public class ResultUtil {

    public static Result success(Object data) {
        return success("成功", data);
    }

    public static Result failed() {
        return failed("");
    }

    public static Result success(String msg, Object data) {
        Result result = new Result();
        result.setCode("SUCCESS");
        result.setMsg(msg);
        result.setData(data);
        return result;
    }

    public static Result failed(String msg) {
        Result result = new Result();
        result.setCode("FAILED");
        result.setMsg(msg);
        return result;
    }
}
